Skip to content

Conversation

snowystinger
Copy link
Member

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@adobe-bot
Copy link

@adobe-bot
Copy link

@adobe-bot
Copy link

reidbarber
reidbarber previously approved these changes Sep 1, 2022
});
}

const ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReturnType<typeof ActionBarInner>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whyyyyy?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because of typescript :( this was the best interpretation of this discussion I could come up with https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref


/** Get an item by its key. */
getItem(key: Key): T,
getItem(key: Key | null): T,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is null allowed here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state.selectionManager.firstSelectedKey can be null https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/actiongroup/src/ActionGroup.tsx#L396

i think you're right, i think the better thing is to include it in the if above

@adobe-bot
Copy link

@adobe-bot
Copy link

@devongovett devongovett merged commit d33458b into main Sep 2, 2022
@devongovett devongovett deleted the ts-strictmode-actiongroup branch September 2, 2022 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants